﻿using System.ComponentModel;
using System.ServiceProcess;

/// <summary>
/// Manages the install of a service process.
/// </summary>
[RunInstaller(true)]
public sealed class CustomInstallerProcess : ServiceProcessInstaller
{
    /// <summary>
    /// Initializes a new instance of the <typeparamref name="CustomInstallerProcess"/> class.
    /// </summary>
    public CustomInstallerProcess()
    {
        this.Account = ServiceAccount.LocalSystem;
    }
}

/// <summary>
/// Manages the install of a service.
/// </summary>
[RunInstaller(true)]
public sealed class CustomInstaller : ServiceInstaller
{
    #region Static Properties

    public static string ServiceDisplayName { get; set; }

    #endregion

    #region Static Constructor

    static CustomInstaller() {
        CustomInstaller.ServiceDisplayName = "Billing Service.";
    }

    #endregion

    /// <summary>
    /// Initializes a new instance of the <typeparamref name="CustomInstaller"/> class.
    /// </summary>
    public CustomInstaller()
    {
        this.Description = "Service for billing.";
        this.DisplayName = CustomInstaller.ServiceDisplayName;
        this.ServiceName = "BillingService";
        this.StartType = ServiceStartMode.Automatic;
    }
}

